import 'package:flutter/cupertino.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_fai_webview/flutter_fai_webview.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import '../../AppConfig/Config.dart';

class FrequentlyAQ extends StatefulWidget {
  const FrequentlyAQ({super.key});

  @override
  State<FrequentlyAQ> createState() => _FrequentlyAQState();
}

class _FrequentlyAQState extends State<FrequentlyAQ> {
  @override
  Widget build(BuildContext context) {
    final screenSize = MediaQuery.of(context).size;
    return Scaffold(
      backgroundColor:Colors.white,
      appBar: AppBar(
        centerTitle: true,
        backgroundColor: Colors.white,
        title: Text("常见问题",style: TextStyle(color: Colors.black,fontSize: 16.sp,fontWeight: FontWeight.w300),),
      ),
      body: ListView(
        children: [
          Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Text("货损情况怎么办？",style: TextStyle(color: Colors.black,fontSize: 18.sp,fontWeight: FontWeight.w600),),
            ],
          ),
          SizedBox(height: 10.h,),
          Container(
            margin: EdgeInsets.only(left: 10.w,right: 10.w),
            width: screenSize.width,
            child: Text("1、首先明确货损/货少是否是司机责任导致的，保留货在司机车上损坏的照片视频，司机承认货损/货少是自己原因的聊天凭证录音等;\n2、需要司机赔偿需提供货物价值清单、厂家索赔函材料证明损失金额，若没有证明，无法邀请司机赔偿；\n3、协商未果，运单点击投诉，上传凭证，客服介入调解。"
            ,style: TextStyle(color: MyColors.textColor,fontSize: 16.sp),),
          ),
          SizedBox(height: 16.h,),
          Container(
            padding: EdgeInsets.only(left: 10.w,right: 10.w),
            child: RichText(
              text: TextSpan(
                text: '详情请点击 ', // 第一部分文本
                style: TextStyle(color: MyColors.textColor,fontSize: 16.sp),
                children: [

                  TextSpan(
                    text: '《速配货平台用户违规行为处理规则》', // 第二部分文本
                    style: TextStyle(color: MyColors.blueColor,fontSize: 16.sp),
                    recognizer: TapGestureRecognizer()..onTap = () {

                    },
                  ),
                ],
              ),
            ),
          ),
          SizedBox(height: 16.h,),
          Container(
            margin: EdgeInsets.only(left: 10.w,right: 10.w),
            height: screenSize.height/2,
            child:  FaiWebViewWidget(
              // 你可以在这里配置 WebView 的属性和参数
              url: 'https://www.baidu.com', // 替换为你要加载的网页URL
              isLog: true,

            ),
          )
        ],
      ),
    );
  }
}
